﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Vergnaty.Repository;
using Vergnaty.Repository.Model;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
            GenericTableRepository repository = new GenericTableRepository(connectionString);

            //FIRST TEST GET USERS
            IList<User> users = repository.GetDatas<User>();

            Console.WriteLine("==========================Call Generic Repository===========================");
            Console.WriteLine("====================AutoMapper IDataReader to Entity========================\n\n");
            foreach (var user in users)
            {
                Console.WriteLine(string.Format(" # {0} {1} {2} \n",user.FistName,user.LastName,user.Email));
                Console.WriteLine("_______________________________________________________________________\n");
            }
            
            Console.ReadLine();
        }
    }
}
